package org.itheima.anno;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.itheima.validation.StateValidation;

import java.lang.annotation.*;



@Documented//元注解
@Constraint(
        validatedBy = {StateValidation.class}// 指定校验规则类
)
@Target({/*ElementType.METHOD, */ElementType.FIELD/*, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE*/})//元注解
@Retention(RetentionPolicy.RUNTIME)//元注解
/*@Repeatable(List.class)*/
public @interface State {

    //提供校验失败后的校验信息
    String message() default "state参数的值只能是“已发布”或者“草稿”";


    //指定分组
    Class<?>[] groups() default {};


    //负载，获取state注解附加信息
    Class<? extends Payload>[] payload() default {};
}
